#include <string>
#include <vector>
#include <iostream>
using namespace std;
#include "net/btypes.h"
using namespace tdl;

//////////////////////
int main(int argc, char* argv[])
{
	// test for ip_end
	cout << "===== test for ip_end =====" << endl;
	ip_end ip1 = "192.168.1.2";
	cout << ip1 << endl;

	ip_end ip2("192.168.1.2");
	cout << (ip1 == ip2) << endl;

	uint32_t cip = ip1.to_int();
	ip_end ip3(cip);
	cout << ip3.to_string() << endl;

	// test for host_addr
	cout << "===== test for host_addr =====" << endl;
	host_addr ha1 = "192.168.1.3:9527";
	cout << ha1 << endl;

	host_addr ha2(ha1);
	cout << ha2 << endl;

	host_addr ha5(ip3, 9527);
	cout << (ha2 == ha5) << endl;

	host_addr ha3("192.168.1.3", 9527);
	host_addr ha4 = ha3;
	cout << (ha3 != ha4) << endl;

	return 0;
}

